package com.dxy.yesas2020goals.study.others.enumlearn.v1;

/**
 * @author victorydeng
 * @Classname EnumTest
 * @Description TODO
 * @Date 2020/5/12 9:57
 * @Created by victorydeng
 */
public class EnumTest {
//    public static void main(String[] args) {
//        System.out.println(SeasonEnum.SPRING);
//        System.out.println(SeasonEnum.SPRING.name());
//        System.out.println(SeasonEnum.SPRING.ordinal());
//        System.out.println(SeasonEnum.SUMMER);
//        System.out.println(SeasonEnum.SUMMER.name());
//        System.out.println(SeasonEnum.SUMMER.ordinal());
//
//    }

    public static void main(String[] args) {
        System.out.println("---->" + SeasonEnum.getNextSeason(SeasonEnum.SPRING).toString());
        System.out.println("---->" + SeasonEnum.getNextSeason(SeasonEnum.SUMMER).toString());
        System.out.println("---->" + SeasonEnum.getNextSeason(SeasonEnum.AUTUMN).toString());
        System.out.println("---->" + SeasonEnum.getNextSeason(SeasonEnum.WINTER).toString());
        //比较那个枚举变量的大小
        System.out.println(SeasonEnum.SPRING.compareTo(SeasonEnum.SUMMER));
        //switch 判断
        new EnumTest().judge(SeasonEnum.AUTUMN);

    }

    public void judge(SeasonEnum s) {
        switch (s) {
            case SPRING:
                System.out.println("spring");
                break;
            case SUMMER:
                System.out.println("summer");
                break;
            case AUTUMN:
                System.out.println("autumn");
                break;
            case WINTER:
                System.out.println("winter");
                break;
            default:
                System.out.println("出现异常的季节");
        }

    }
}
